package o;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffXfermode;
import android.graphics.Region.Op;
import android.util.SparseArray;
import com.google.android.exoplayer2.text.Cue;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

final class ajx {
    private static final byte[] ˊ = new byte[]{(byte) 0, (byte) 119, (byte) -120, (byte) -1};
    private static final byte[] ˎ = new byte[]{(byte) 0, (byte) 7, (byte) 8, (byte) 15};
    private static final byte[] ˏ = new byte[]{(byte) 0, (byte) 17, (byte) 34, (byte) 51, (byte) 68, (byte) 85, (byte) 102, (byte) 119, (byte) -120, (byte) -103, (byte) -86, (byte) -69, (byte) -52, (byte) -35, (byte) -18, (byte) -1};
    private final j ʻ;
    private Bitmap ʼ;
    private final c ʽ;
    private final Paint ˋ;
    private final Paint ॱ = new Paint();
    private final Canvas ॱॱ;
    private final b ᐝ;

    static final class a {
        public final byte[] ˋ;
        public final byte[] ˎ;
        public final int ˏ;
        public final boolean ॱ;

        public a(int i, boolean z, byte[] bArr, byte[] bArr2) {
            this.ˏ = i;
            this.ॱ = z;
            this.ˎ = bArr;
            this.ˋ = bArr2;
        }
    }

    static final class b {
        public final int ʼ;
        public final int ˊ;
        public final int ˋ;
        public final int ˎ;
        public final int ˏ;
        public final int ॱ;

        public b(int i, int i2, int i3, int i4, int i5, int i6) {
            this.ˏ = i;
            this.ˊ = i2;
            this.ˎ = i3;
            this.ˋ = i4;
            this.ॱ = i5;
            this.ʼ = i6;
        }
    }

    static final class c {
        public final int[] ˊ;
        public final int ˋ;
        public final int[] ˎ;
        public final int[] ˏ;

        public c(int i, int[] iArr, int[] iArr2, int[] iArr3) {
            this.ˋ = i;
            this.ˏ = iArr;
            this.ˊ = iArr2;
            this.ˎ = iArr3;
        }
    }

    static final class d {
        public final SparseArray<e> ˋ;
        public final int ˎ;
        public final int ˏ;
        public final int ॱ;

        public d(int i, int i2, int i3, SparseArray<e> sparseArray) {
            this.ॱ = i;
            this.ˏ = i2;
            this.ˎ = i3;
            this.ˋ = sparseArray;
        }
    }

    static final class e {
        public final int ˋ;
        public final int ˎ;

        public e(int i, int i2) {
            this.ˎ = i;
            this.ˋ = i2;
        }
    }

    static final class g {
        public final int ʻ;
        public final int ʼ;
        public final int ʽ;
        public final int ˊ;
        public final boolean ˋ;
        public final int ˎ;
        public final int ˏ;
        public final int ॱ;
        public final SparseArray<h> ॱˊ;
        public final int ॱॱ;
        public final int ᐝ;

        public g(int i, boolean z, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, SparseArray<h> sparseArray) {
            this.ˊ = i;
            this.ˋ = z;
            this.ॱ = i2;
            this.ˏ = i3;
            this.ˎ = i4;
            this.ʼ = i5;
            this.ॱॱ = i6;
            this.ʻ = i7;
            this.ᐝ = i8;
            this.ʽ = i9;
            this.ॱˊ = sparseArray;
        }

        public void ˊ(g gVar) {
            if (gVar != null) {
                SparseArray sparseArray = gVar.ॱˊ;
                for (int i = 0; i < sparseArray.size(); i++) {
                    this.ॱˊ.put(sparseArray.keyAt(i), sparseArray.valueAt(i));
                }
            }
        }
    }

    static final class h {
        public final int ˊ;
        public final int ˋ;
        public final int ˎ;
        public final int ˏ;
        public final int ॱ;
        public final int ᐝ;

        public h(int i, int i2, int i3, int i4, int i5, int i6) {
            this.ॱ = i;
            this.ˋ = i2;
            this.ˎ = i3;
            this.ˊ = i4;
            this.ˏ = i5;
            this.ᐝ = i6;
        }
    }

    static final class j {
        public d ʼ;
        public b ʽ;
        public final SparseArray<c> ˊ = new SparseArray();
        public final int ˋ;
        public final int ˎ;
        public final SparseArray<a> ˏ = new SparseArray();
        public final SparseArray<g> ॱ = new SparseArray();
        public final SparseArray<a> ॱॱ = new SparseArray();
        public final SparseArray<c> ᐝ = new SparseArray();

        public j(int i, int i2) {
            this.ˎ = i;
            this.ˋ = i2;
        }

        public void ˋ() {
            this.ॱ.clear();
            this.ˊ.clear();
            this.ˏ.clear();
            this.ᐝ.clear();
            this.ॱॱ.clear();
            this.ʽ = null;
            this.ʼ = null;
        }
    }

    public ajx(int i, int i2) {
        this.ॱ.setStyle(Style.FILL_AND_STROKE);
        this.ॱ.setXfermode(new PorterDuffXfermode(Mode.SRC));
        this.ॱ.setPathEffect(null);
        this.ˋ = new Paint();
        this.ˋ.setStyle(Style.FILL);
        this.ˋ.setXfermode(new PorterDuffXfermode(Mode.DST_OVER));
        this.ˋ.setPathEffect(null);
        this.ॱॱ = new Canvas();
        this.ᐝ = new b(719, 575, 0, 719, 0, 575);
        this.ʽ = new c(0, ˏ(), ˋ(), ˊ());
        this.ʻ = new j(i, i2);
    }

    public void ˎ() {
        this.ʻ.ˋ();
    }

    public List<Cue> ˏ(byte[] bArr, int i) {
        ane o_ane = new ane(bArr, i);
        while (o_ane.ˏ() >= 48 && o_ane.ॱ(8) == 15) {
            ˏ(o_ane, this.ʻ);
        }
        if (this.ʻ.ʼ == null) {
            return Collections.emptyList();
        }
        b bVar;
        if (this.ʻ.ʽ != null) {
            bVar = this.ʻ.ʽ;
        } else {
            bVar = this.ᐝ;
        }
        if (!(this.ʼ != null && bVar.ˏ + 1 == this.ʼ.getWidth() && bVar.ˊ + 1 == this.ʼ.getHeight())) {
            this.ʼ = Bitmap.createBitmap(bVar.ˏ + 1, bVar.ˊ + 1, Config.ARGB_8888);
            this.ॱॱ.setBitmap(this.ʼ);
        }
        List<Cue> arrayList = new ArrayList();
        SparseArray sparseArray = this.ʻ.ʼ.ˋ;
        for (int i2 = 0; i2 < sparseArray.size(); i2++) {
            c cVar;
            SparseArray sparseArray2;
            int i3;
            int keyAt;
            h hVar;
            a aVar;
            int i4;
            e eVar = (e) sparseArray.valueAt(i2);
            g gVar = (g) this.ʻ.ॱ.get(sparseArray.keyAt(i2));
            int i5 = eVar.ˎ + bVar.ˎ;
            int i6 = eVar.ˋ + bVar.ॱ;
            this.ॱॱ.clipRect((float) i5, (float) i6, (float) Math.min(gVar.ॱ + i5, bVar.ˋ), (float) Math.min(gVar.ˏ + i6, bVar.ʼ), Op.REPLACE);
            c cVar2 = (c) this.ʻ.ˊ.get(gVar.ॱॱ);
            if (cVar2 == null) {
                cVar2 = (c) this.ʻ.ᐝ.get(gVar.ॱॱ);
                if (cVar2 == null) {
                    cVar = this.ʽ;
                    sparseArray2 = gVar.ॱˊ;
                    for (i3 = 0; i3 < sparseArray2.size(); i3++) {
                        keyAt = sparseArray2.keyAt(i3);
                        hVar = (h) sparseArray2.valueAt(i3);
                        aVar = (a) this.ʻ.ˏ.get(keyAt);
                        if (aVar == null) {
                            aVar = (a) this.ʻ.ॱॱ.get(keyAt);
                        }
                        if (aVar == null) {
                            ॱ(aVar, cVar, gVar.ʼ, hVar.ˎ + i5, hVar.ˊ + i6, aVar.ॱ ? null : this.ॱ, this.ॱॱ);
                        }
                    }
                    if (!gVar.ˋ) {
                        if (gVar.ʼ == 3) {
                            i4 = cVar.ˎ[gVar.ʻ];
                        } else if (gVar.ʼ != 2) {
                            i4 = cVar.ˊ[gVar.ᐝ];
                        } else {
                            i4 = cVar.ˏ[gVar.ʽ];
                        }
                        this.ˋ.setColor(i4);
                        this.ॱॱ.drawRect((float) i5, (float) i6, (float) (gVar.ॱ + i5), (float) (gVar.ˏ + i6), this.ˋ);
                    }
                    arrayList.add(new Cue(Bitmap.createBitmap(this.ʼ, i5, i6, gVar.ॱ, gVar.ˏ), ((float) i5) / ((float) bVar.ˏ), 0, ((float) i6) / ((float) bVar.ˊ), 0, ((float) gVar.ॱ) / ((float) bVar.ˏ), ((float) gVar.ˏ) / ((float) bVar.ˊ)));
                    this.ॱॱ.drawColor(0, Mode.CLEAR);
                }
            }
            cVar = cVar2;
            sparseArray2 = gVar.ॱˊ;
            for (i3 = 0; i3 < sparseArray2.size(); i3++) {
                keyAt = sparseArray2.keyAt(i3);
                hVar = (h) sparseArray2.valueAt(i3);
                aVar = (a) this.ʻ.ˏ.get(keyAt);
                if (aVar == null) {
                    aVar = (a) this.ʻ.ॱॱ.get(keyAt);
                }
                if (aVar == null) {
                    if (aVar.ॱ) {
                    }
                    ॱ(aVar, cVar, gVar.ʼ, hVar.ˎ + i5, hVar.ˊ + i6, aVar.ॱ ? null : this.ॱ, this.ॱॱ);
                }
            }
            if (!gVar.ˋ) {
                if (gVar.ʼ == 3) {
                    i4 = cVar.ˎ[gVar.ʻ];
                } else if (gVar.ʼ != 2) {
                    i4 = cVar.ˏ[gVar.ʽ];
                } else {
                    i4 = cVar.ˊ[gVar.ᐝ];
                }
                this.ˋ.setColor(i4);
                this.ॱॱ.drawRect((float) i5, (float) i6, (float) (gVar.ॱ + i5), (float) (gVar.ˏ + i6), this.ˋ);
            }
            arrayList.add(new Cue(Bitmap.createBitmap(this.ʼ, i5, i6, gVar.ॱ, gVar.ˏ), ((float) i5) / ((float) bVar.ˏ), 0, ((float) i6) / ((float) bVar.ˊ), 0, ((float) gVar.ॱ) / ((float) bVar.ˏ), ((float) gVar.ˏ) / ((float) bVar.ˊ)));
            this.ॱॱ.drawColor(0, Mode.CLEAR);
        }
        return arrayList;
    }

    private static void ˏ(ane o_ane, j jVar) {
        int ॱ = o_ane.ॱ(8);
        int ॱ2 = o_ane.ॱ(16);
        int ॱ3 = o_ane.ॱ(16);
        int ˎ = o_ane.ˎ() + ॱ3;
        if (ॱ3 * 8 > o_ane.ˏ()) {
            amz.ˏ("DvbParser", "Data field length exceeds limit");
            o_ane.ˎ(o_ane.ˏ());
            return;
        }
        d dVar;
        switch (ॱ) {
            case 16:
                if (ॱ2 == jVar.ˎ) {
                    dVar = jVar.ʼ;
                    d ॱ4 = ॱ(o_ane, ॱ3);
                    if (ॱ4.ˎ == 0) {
                        if (!(dVar == null || dVar.ˏ == ॱ4.ˏ)) {
                            jVar.ʼ = ॱ4;
                            break;
                        }
                    }
                    jVar.ʼ = ॱ4;
                    jVar.ॱ.clear();
                    jVar.ˊ.clear();
                    jVar.ˏ.clear();
                    break;
                }
                break;
            case 17:
                dVar = jVar.ʼ;
                if (ॱ2 == jVar.ˎ && dVar != null) {
                    g ˊ = ˊ(o_ane, ॱ3);
                    if (dVar.ˎ == 0) {
                        ˊ.ˊ((g) jVar.ॱ.get(ˊ.ˊ));
                    }
                    jVar.ॱ.put(ˊ.ˊ, ˊ);
                    break;
                }
            case 18:
                c ˎ2;
                if (ॱ2 != jVar.ˎ) {
                    if (ॱ2 == jVar.ˋ) {
                        ˎ2 = ˎ(o_ane, ॱ3);
                        jVar.ᐝ.put(ˎ2.ˋ, ˎ2);
                        break;
                    }
                }
                ˎ2 = ˎ(o_ane, ॱ3);
                jVar.ˊ.put(ˎ2.ˋ, ˎ2);
                break;
                break;
            case 19:
                a ˏ;
                if (ॱ2 != jVar.ˎ) {
                    if (ॱ2 == jVar.ˋ) {
                        ˏ = ˏ(o_ane);
                        jVar.ॱॱ.put(ˏ.ˏ, ˏ);
                        break;
                    }
                }
                ˏ = ˏ(o_ane);
                jVar.ˏ.put(ˏ.ˏ, ˏ);
                break;
                break;
            case 20:
                if (ॱ2 == jVar.ˎ) {
                    jVar.ʽ = ˊ(o_ane);
                    break;
                }
                break;
        }
        o_ane.ˏ(ˎ - o_ane.ˎ());
    }

    private static b ˊ(ane o_ane) {
        int ॱ;
        int ॱ2;
        int ॱ3;
        int i = 0;
        o_ane.ˎ(4);
        boolean ˊ = o_ane.ˊ();
        o_ane.ˎ(3);
        int ॱ4 = o_ane.ॱ(16);
        int ॱ5 = o_ane.ॱ(16);
        if (ˊ) {
            ॱ = o_ane.ॱ(16);
            ॱ2 = o_ane.ॱ(16);
            i = o_ane.ॱ(16);
            ॱ3 = o_ane.ॱ(16);
        } else {
            ॱ3 = ॱ5;
            ॱ2 = ॱ4;
            ॱ = 0;
        }
        return new b(ॱ4, ॱ5, ॱ, ॱ2, i, ॱ3);
    }

    private static d ॱ(ane o_ane, int i) {
        int ॱ = o_ane.ॱ(8);
        int ॱ2 = o_ane.ॱ(4);
        int ॱ3 = o_ane.ॱ(2);
        o_ane.ˎ(2);
        int i2 = i - 2;
        SparseArray sparseArray = new SparseArray();
        while (i2 > 0) {
            int ॱ4 = o_ane.ॱ(8);
            o_ane.ˎ(8);
            i2 -= 6;
            sparseArray.put(ॱ4, new e(o_ane.ॱ(16), o_ane.ॱ(16)));
        }
        return new d(ॱ, ॱ2, ॱ3, sparseArray);
    }

    private static g ˊ(ane o_ane, int i) {
        int ॱ = o_ane.ॱ(8);
        o_ane.ˎ(4);
        boolean ˊ = o_ane.ˊ();
        o_ane.ˎ(3);
        int ॱ2 = o_ane.ॱ(16);
        int ॱ3 = o_ane.ॱ(16);
        int ॱ4 = o_ane.ॱ(3);
        int ॱ5 = o_ane.ॱ(3);
        o_ane.ˎ(2);
        int ॱ6 = o_ane.ॱ(8);
        int ॱ7 = o_ane.ॱ(8);
        int ॱ8 = o_ane.ॱ(4);
        int ॱ9 = o_ane.ॱ(2);
        o_ane.ˎ(2);
        int i2 = i - 10;
        SparseArray sparseArray = new SparseArray();
        while (i2 > 0) {
            int ॱ10 = o_ane.ॱ(16);
            int ॱ11 = o_ane.ॱ(2);
            int ॱ12 = o_ane.ॱ(2);
            int ॱ13 = o_ane.ॱ(12);
            o_ane.ˎ(4);
            int ॱ14 = o_ane.ॱ(12);
            int i3 = i2 - 6;
            int i4 = 0;
            int i5 = 0;
            if (ॱ11 == 1 || ॱ11 == 2) {
                i4 = o_ane.ॱ(8);
                i5 = o_ane.ॱ(8);
                i2 = i3 - 2;
            } else {
                i2 = i3;
            }
            sparseArray.put(ॱ10, new h(ॱ11, ॱ12, ॱ13, ॱ14, i4, i5));
        }
        return new g(ॱ, ˊ, ॱ2, ॱ3, ॱ4, ॱ5, ॱ6, ॱ7, ॱ8, ॱ9, sparseArray);
    }

    private static c ˎ(ane o_ane, int i) {
        int ॱ = o_ane.ॱ(8);
        o_ane.ˎ(8);
        int i2 = i - 2;
        int[] ˏ = ˏ();
        int[] ˋ = ˋ();
        int[] ˊ = ˊ();
        while (i2 > 0) {
            int[] iArr;
            int ॱ2;
            int ॱ3;
            int ॱ4;
            int ॱ5 = o_ane.ॱ(8);
            int ॱ6 = o_ane.ॱ(8);
            i2 -= 2;
            if ((ॱ6 & DnsConfig.MAX_CACHE_ENTRIES) != 0) {
                iArr = ˏ;
            } else if ((ॱ6 & 64) != 0) {
                iArr = ˋ;
            } else {
                iArr = ˊ;
            }
            if ((ॱ6 & 1) != 0) {
                ॱ2 = o_ane.ॱ(8);
                ॱ3 = o_ane.ॱ(8);
                ॱ4 = o_ane.ॱ(8);
                ॱ6 = o_ane.ॱ(8);
                i2 -= 4;
            } else {
                ॱ2 = o_ane.ॱ(6) << 2;
                ॱ3 = o_ane.ॱ(4) << 4;
                ॱ4 = o_ane.ॱ(4) << 4;
                ॱ6 = o_ane.ॱ(2) << 6;
                i2 -= 2;
            }
            if (ॱ2 == 0) {
                ॱ3 = 0;
                ॱ4 = 0;
                ॱ6 = 255;
            }
            iArr[ॱ5] = ˊ((byte) (255 - (ॱ6 & 255)), anr.ॱ((int) (((double) ॱ2) + (1.402d * ((double) (ॱ3 - 128)))), 0, 255), anr.ॱ((int) ((((double) ॱ2) - (0.34414d * ((double) (ॱ4 - 128)))) - (0.71414d * ((double) (ॱ3 - 128)))), 0, 255), anr.ॱ((int) (((double) ॱ2) + (1.772d * ((double) (ॱ4 - 128)))), 0, 255));
        }
        return new c(ॱ, ˏ, ˋ, ˊ);
    }

    private static a ˏ(ane o_ane) {
        byte[] bArr;
        byte[] bArr2 = null;
        int ॱ = o_ane.ॱ(16);
        o_ane.ˎ(4);
        int ॱ2 = o_ane.ॱ(2);
        boolean ˊ = o_ane.ˊ();
        o_ane.ˎ(1);
        if (ॱ2 == 1) {
            o_ane.ˎ(o_ane.ॱ(8) * 16);
            bArr = null;
        } else if (ॱ2 == 0) {
            int ॱ3 = o_ane.ॱ(16);
            int ॱ4 = o_ane.ॱ(16);
            if (ॱ3 > 0) {
                bArr = new byte[ॱ3];
                o_ane.ˏ(bArr, 0, ॱ3);
            } else {
                bArr = null;
            }
            if (ॱ4 > 0) {
                bArr2 = new byte[ॱ4];
                o_ane.ˏ(bArr2, 0, ॱ4);
            } else {
                bArr2 = bArr;
            }
        } else {
            bArr = null;
        }
        return new a(ॱ, ˊ, bArr, bArr2);
    }

    private static int[] ˏ() {
        return new int[]{0, -1, -16777216, -8421505};
    }

    private static int[] ˋ() {
        int[] iArr = new int[16];
        iArr[0] = 0;
        for (int i = 1; i < iArr.length; i++) {
            if (i < 8) {
                int i2;
                if ((i & 1) != 0) {
                    i2 = 255;
                } else {
                    i2 = 0;
                }
                iArr[i] = ˊ(255, i2, (i & 2) != 0 ? 255 : 0, (i & 4) != 0 ? 255 : 0);
            } else {
                iArr[i] = ˊ(255, (i & 1) != 0 ? 127 : 0, (i & 2) != 0 ? 127 : 0, (i & 4) != 0 ? 127 : 0);
            }
        }
        return iArr;
    }

    private static int[] ˊ() {
        int[] iArr = new int[256];
        iArr[0] = 0;
        for (int i = 0; i < iArr.length; i++) {
            if (i >= 8) {
                switch (i & 136) {
                    case 0:
                        iArr[i] = ˊ(255, ((i & 1) != 0 ? 85 : 0) + ((i & 16) != 0 ? 170 : 0), ((i & 2) != 0 ? 85 : 0) + ((i & 32) != 0 ? 170 : 0), ((i & 64) != 0 ? 170 : 0) + ((i & 4) != 0 ? 85 : 0));
                        break;
                    case 8:
                        iArr[i] = ˊ(127, ((i & 1) != 0 ? 85 : 0) + ((i & 16) != 0 ? 170 : 0), ((i & 2) != 0 ? 85 : 0) + ((i & 32) != 0 ? 170 : 0), ((i & 64) != 0 ? 170 : 0) + ((i & 4) != 0 ? 85 : 0));
                        break;
                    case DnsConfig.MAX_CACHE_ENTRIES /*128*/:
                        iArr[i] = ˊ(255, (((i & 1) != 0 ? 43 : 0) + 127) + ((i & 16) != 0 ? 85 : 0), (((i & 2) != 0 ? 43 : 0) + 127) + ((i & 32) != 0 ? 85 : 0), ((i & 64) != 0 ? 85 : 0) + (((i & 4) != 0 ? 43 : 0) + 127));
                        break;
                    case 136:
                        iArr[i] = ˊ(255, ((i & 1) != 0 ? 43 : 0) + ((i & 16) != 0 ? 85 : 0), ((i & 2) != 0 ? 43 : 0) + ((i & 32) != 0 ? 85 : 0), ((i & 64) != 0 ? 85 : 0) + ((i & 4) != 0 ? 43 : 0));
                        break;
                    default:
                        break;
                }
            }
            int i2;
            if ((i & 1) != 0) {
                i2 = 255;
            } else {
                i2 = 0;
            }
            iArr[i] = ˊ(63, i2, (i & 2) != 0 ? 255 : 0, (i & 4) != 0 ? 255 : 0);
        }
        return iArr;
    }

    private static int ˊ(int i, int i2, int i3, int i4) {
        return (((i << 24) | (i2 << 16)) | (i3 << 8)) | i4;
    }

    private static void ॱ(a aVar, c cVar, int i, int i2, int i3, Paint paint, Canvas canvas) {
        int[] iArr;
        if (i == 3) {
            iArr = cVar.ˎ;
        } else if (i == 2) {
            iArr = cVar.ˊ;
        } else {
            iArr = cVar.ˏ;
        }
        ˊ(aVar.ˎ, iArr, i, i2, i3, paint, canvas);
        ˊ(aVar.ˋ, iArr, i, i2, i3 + 1, paint, canvas);
    }

    private static void ˊ(byte[] bArr, int[] iArr, int i, int i2, int i3, Paint paint, Canvas canvas) {
        ane o_ane = new ane(bArr);
        byte[] bArr2 = null;
        byte[] bArr3 = null;
        int i4 = i3;
        int i5 = i2;
        while (o_ane.ˏ() != 0) {
            byte[] bArr4;
            byte[] bArr5;
            switch (o_ane.ॱ(8)) {
                case 16:
                    if (i == 3) {
                        bArr4 = bArr3 == null ? ˊ : bArr3;
                    } else if (i == 2) {
                        bArr4 = bArr2 == null ? ˎ : bArr2;
                    } else {
                        bArr4 = null;
                    }
                    i5 = ॱ(o_ane, iArr, bArr4, i5, i4, paint, canvas);
                    o_ane.ʻ();
                    bArr5 = bArr3;
                    bArr4 = bArr2;
                    break;
                case 17:
                    if (i == 3) {
                        bArr4 = null == null ? ˏ : null;
                    } else {
                        bArr4 = null;
                    }
                    i5 = ˎ(o_ane, iArr, bArr4, i5, i4, paint, canvas);
                    o_ane.ʻ();
                    bArr5 = bArr3;
                    bArr4 = bArr2;
                    break;
                case 18:
                    i5 = ˋ(o_ane, iArr, null, i5, i4, paint, canvas);
                    bArr5 = bArr3;
                    bArr4 = bArr2;
                    break;
                case 32:
                    bArr4 = ˎ(4, 4, o_ane);
                    bArr5 = bArr3;
                    break;
                case 33:
                    bArr5 = ˎ(4, 8, o_ane);
                    bArr4 = bArr2;
                    break;
                case 34:
                    bArr5 = ˎ(16, 8, o_ane);
                    bArr4 = bArr2;
                    break;
                case 240:
                    i4 += 2;
                    bArr5 = bArr3;
                    bArr4 = bArr2;
                    i5 = i2;
                    break;
                default:
                    bArr5 = bArr3;
                    bArr4 = bArr2;
                    break;
            }
            bArr3 = bArr5;
            bArr2 = bArr4;
        }
    }

    private static int ॱ(ane o_ane, int[] iArr, byte[] bArr, int i, int i2, Paint paint, Canvas canvas) {
        Object obj = null;
        while (true) {
            int i3;
            int i4;
            Object obj2;
            int ॱ = o_ane.ॱ(2);
            if (ॱ == 0) {
                if (!o_ane.ˊ()) {
                    if (!o_ane.ˊ()) {
                        switch (o_ane.ॱ(2)) {
                            case 0:
                                i3 = 0;
                                int i5 = 1;
                                i4 = 0;
                                break;
                            case 1:
                                i3 = 2;
                                obj2 = obj;
                                i4 = 0;
                                break;
                            case 2:
                                i3 = o_ane.ॱ(4) + 12;
                                obj2 = obj;
                                i4 = o_ane.ॱ(2);
                                break;
                            case 3:
                                i3 = o_ane.ॱ(8) + 29;
                                obj2 = obj;
                                i4 = o_ane.ॱ(2);
                                break;
                            default:
                                i3 = 0;
                                obj2 = obj;
                                i4 = 0;
                                break;
                        }
                    }
                    i3 = 1;
                    obj2 = obj;
                    i4 = 0;
                } else {
                    i3 = o_ane.ॱ(3) + 3;
                    obj2 = obj;
                    i4 = o_ane.ॱ(2);
                }
            } else {
                i3 = 1;
                obj2 = obj;
                i4 = ॱ;
            }
            if (!(i3 == 0 || paint == null)) {
                if (bArr != null) {
                    i4 = bArr[i4];
                }
                paint.setColor(iArr[i4]);
                Canvas canvas2 = canvas;
                canvas2.drawRect((float) i, (float) i2, (float) (i + i3), (float) (i2 + 1), paint);
            }
            i += i3;
            if (obj2 != null) {
                return i;
            }
            obj = obj2;
        }
    }

    private static int ˎ(ane o_ane, int[] iArr, byte[] bArr, int i, int i2, Paint paint, Canvas canvas) {
        Object obj = null;
        while (true) {
            int i3;
            Object obj2;
            int i4;
            int ॱ = o_ane.ॱ(4);
            if (ॱ == 0) {
                if (o_ane.ˊ()) {
                    if (o_ane.ˊ()) {
                        switch (o_ane.ॱ(2)) {
                            case 0:
                                i3 = 1;
                                obj2 = obj;
                                i4 = 0;
                                break;
                            case 1:
                                i3 = 2;
                                obj2 = obj;
                                i4 = 0;
                                break;
                            case 2:
                                i3 = o_ane.ॱ(4) + 9;
                                obj2 = obj;
                                i4 = o_ane.ॱ(4);
                                break;
                            case 3:
                                i3 = o_ane.ॱ(8) + 25;
                                obj2 = obj;
                                i4 = o_ane.ॱ(4);
                                break;
                            default:
                                i3 = 0;
                                obj2 = obj;
                                i4 = 0;
                                break;
                        }
                    }
                    i3 = o_ane.ॱ(2) + 4;
                    obj2 = obj;
                    i4 = o_ane.ॱ(4);
                } else {
                    ॱ = o_ane.ॱ(3);
                    if (ॱ != 0) {
                        i3 = ॱ + 2;
                        obj2 = obj;
                        i4 = 0;
                    } else {
                        i3 = 0;
                        int i5 = 1;
                        i4 = 0;
                    }
                }
            } else {
                i3 = 1;
                obj2 = obj;
                i4 = ॱ;
            }
            if (!(i3 == 0 || paint == null)) {
                if (bArr != null) {
                    i4 = bArr[i4];
                }
                paint.setColor(iArr[i4]);
                Canvas canvas2 = canvas;
                canvas2.drawRect((float) i, (float) i2, (float) (i + i3), (float) (i2 + 1), paint);
            }
            i += i3;
            if (obj2 != null) {
                return i;
            }
            obj = obj2;
        }
    }

    private static int ˋ(ane o_ane, int[] iArr, byte[] bArr, int i, int i2, Paint paint, Canvas canvas) {
        Object obj = null;
        while (true) {
            int i3;
            Object obj2;
            int i4;
            int ॱ = o_ane.ॱ(8);
            if (ॱ != 0) {
                i3 = 1;
                obj2 = obj;
                i4 = ॱ;
            } else if (o_ane.ˊ()) {
                i3 = o_ane.ॱ(7);
                obj2 = obj;
                i4 = o_ane.ॱ(8);
            } else {
                int ॱ2 = o_ane.ॱ(7);
                if (ॱ2 != 0) {
                    i3 = ॱ2;
                    obj2 = obj;
                    i4 = 0;
                } else {
                    i3 = 0;
                    int i5 = 1;
                    i4 = 0;
                }
            }
            if (!(i3 == 0 || paint == null)) {
                if (bArr != null) {
                    i4 = bArr[i4];
                }
                paint.setColor(iArr[i4]);
                Canvas canvas2 = canvas;
                canvas2.drawRect((float) i, (float) i2, (float) (i + i3), (float) (i2 + 1), paint);
            }
            i += i3;
            if (obj2 != null) {
                return i;
            }
            obj = obj2;
        }
    }

    private static byte[] ˎ(int i, int i2, ane o_ane) {
        byte[] bArr = new byte[i];
        for (int i3 = 0; i3 < i; i3++) {
            bArr[i3] = (byte) o_ane.ॱ(i2);
        }
        return bArr;
    }
}
